package de.koller.caldera.render.textures.surfaces;

import de.koller.aframe.gl.ATexture;
import de.koller.caldera.CNode;
import de.koller.oceanFramework.gl.util.ParticleTexture;

public class PlanetSurfaces extends CNode {
	
	public final ATexture plain = new PlainSurface();
	public final ATexture plainBump = new PlainBump();
	
	public static void cutOutSphere( ParticleTexture texture ) {
		final float ds = Math.abs( texture.getWidth() * .5f );
		final float c = texture.getWidth() * .5f; 
		for( int x = 0; x < texture.getWidth(); x++ )
			for( int y = 0; y < texture.getHeight(); y++ ) {
				float d = (float)Math.sqrt( (x-c)*(x-c) + (y-c)*(y-c) );
				if( d > ds )
					texture.setPixel( 0, x, y );
			}

	}
	
}
